package org.dwell.vertx3.server;

import org.dwell.vertx3.protocol.Packet;
import org.dwell.vertx3.protocol.Serializer;

/**
 * Created by JianGuo on 2016/1/13.
 */
public class Event {
    public String data;
    public ChatVerticle handler;
    public Packet packet;
    public String actor;

    public Event(String data, ChatVerticle handler) {
        this.data = data;
        this.handler = handler;
        this.packet = (Packet) Serializer.unpack(data, Packet.class);
        this.actor = packet.getHeader().getActor();
    }
}
